#pragma once
#include "Player.h"
#include <iostream>
#include <Windows.h>
#include <NuiApi.h>
#include "EnemyManager.h"
#include <SFML\Audio.hpp>

class Input {
public:
	Input();
	~Input();
	void Initialize(Player* player, EnemyManager* EnemyManager, sf::RenderWindow* window);
	void Update();
	void Cleanup();
	bool TestKinect();
	bool StartKinect();
	bool ScoreKinect();
	void updateCamera();
	void updateJoystick();

	float timer;
	sf::Clock* testClock;
	bool m_quit;  
	void resetCamera()	{	m_cameraX = 960; speed = 0.f;	};
	Player* m_player;
	EnemyManager* m_EnemyManager;
	float m_cameraX;
	int cameraAngle;

	void resetJoystick()	{	joyX = 0.f; speed = 0.f;	};

	bool getHitR(){	return hitR;	};
	bool getHitL(){	return hitL;	};
	sf::Clock* m_inCamera;
	int hits;

private:
#pragma region Kinect
	sf::RenderWindow* m_renderWindow;
	NUI_SKELETON_FRAME ourFrame;
	float leftHandPosZ;
	float rightHandPosZ;
	float rightHandPosX;
	float rightHandPosY;

	float leftShoulderPosZ;
	float rightShoulderPosZ;

	float leftFootPosZ;
	float rightFootPosZ;
	float leftHipPosZ;
	float rightHipPosZ;

	float centerPosX;

	float speed;

	sf::Sound* m_punchSound;
	sf::SoundBuffer* m_punchBuffer;
	sf::Sound* m_missSound;
	sf::SoundBuffer* m_missBuffer;

	bool gobackleft;
	bool gobackright;
	bool clockStartR;
	float timerR;
	bool hitR;
	bool clockStartL;
	float timerL;
	bool hitL;
	bool missedR;
	bool missedL;



	bool gobackleftF;
	bool gobackrightF;
	bool clockStartRf;
	float timerRf;
	bool hitRf;
	bool clockStartLf;
	float timerLf;
	bool hitLf;
	bool missedRf;
	bool missedLf;

	bool deltaBool;
	float deltaTime;
	float deltaTime1;
	float deltaTime2;
	sf::Clock*	m_clock;
	float m_testTimer;
	sf::Font* m_font;
	sf::Text* m_text;
	sf::Text* m_text2;
	sf::Texture* m_backgroundTexture;
	sf::Sprite* m_backgroundSprite;

	bool scoreHitL;
	bool scoreHitR;


	float m_lastPos;


#pragma endregion

	bool joystickConnected;
	unsigned int buttonCount;
	bool hasZ;
	float joyX;
	float joyY;
	float joyZ;


};

